/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package rad.Java.MotelPlus.List;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import rad.Java.Common.Class.DefaultList;
import rad.Java.Common.Class.IList;
import rad.Java.Common.DB.GenerateSql;
import rad.Java.MotelPlus.Class.Status;

/**
 *
 * @author Renato ferreira dos santos
 */
public class Statuss extends DefaultList implements IList{
    // <editor-fold defaultstate="collapsed" desc="Declaration of variables">
        private Status s;
    // </editor-fold>
    
    public Statuss()
    {
        s = new Status();
        _gsql = new GenerateSql();
        _gsql.setTable("status");
    }
    
    // <editor-fold defaultstate="collapsed" desc="Declaration of functions">
        public boolean fillList()
        {
            throw new UnsupportedOperationException("Not supported yet.");
        }

        public Status get(int index)
        {
            return (Status) _items.get(index);
        }

        private boolean mountList()
        {
            try {
                ResultSet rs;
                if (!_gsql.execute(false)) {
                    return false;
                }
                clear();
                while (_gsql.next()) {
                    Status status = new Status();
                    status.get(_gsql.getResultSet());
                    _items.add(status);
                }
                return true;
            }
            catch (SQLException ex) {
                Logger.getLogger(Statuss.class.getName()).log(Level.SEVERE, null, ex);
                return false;
            }
        }
    // </editor-fold>
}
